package web.mb;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import metier.entities.Client;
import metier.entities.TransportCat;
import metier.sess.IUtilisateurLocal;

import org.primefaces.component.commandbutton.CommandButton;


@ManagedBean
@ViewScoped
public class TestMB {
	
	@EJB
	private IUtilisateurLocal metier;
	
	 private List<String> list=new ArrayList<String>();

	private String a;
	private Integer i=new Integer('0');


	
	public Integer getI() {
		return i;
	}

	
	
	public List<TransportCat> listeTr()
	{
	   Client c=(Client) metier.getUtilisateur(12);
		 return c.getListTransportTrCat();
	}
	
	public void setI(Integer i) {
		this.i = i;
	}

	public String getA() {
		return a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@PostConstruct
	public void init()
	{
		list.add("");
	}
	
	public List<String> getList() {
		return list;
	}

	public void setList(List<String> list) {
		this.list = list;
	}
	
	
	public void AJOUTER()
	{
		list.add("");
		System.out.println(list.size());
		a=list.size()+"";
	}
	
	public void a()
	{
		for(int i=0;i<list.size();i++)
		System.out.println(list.get(i));
		
	}
	public void remove(String i)
	{
		list.remove(list.get(Integer.parseInt(i)));
		System.out.println("ici"+list.size());
	}

}
